package o;

import android.os.Bundle;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import o.cjo.b;
import o.cjo.c;

public class cjq {
    private Bundle ˊ;
    private Bundle ˋ;
    private cjo ˏ;
    private String ॱ;

    public cjq(String str) {
        this.ॱ = str;
    }

    public cjq ˊ(Bundle bundle) {
        this.ˊ = bundle;
        return this;
    }

    public cjq ˎ() {
        this.ˊ = new Bundle();
        return this;
    }

    public cjo ˏ() {
        cji ॱ;
        if (this.ˏ == null) {
            try {
                this.ˏ = (cjo) cjl.ˏ(this.ॱ).ˋ().newInstance();
            } catch (Exception e) {
                return null;
            }
        }
        cjt o_cjt = new cjt();
        if (this.ˊ != null) {
            ॱ = ॱ(this.ˏ.getClass(), b.class);
            if (ॱ != null) {
                ॱ.ॱ(this.ˏ, o_cjt.ॱ(this.ˊ, ॱ.ˊ()));
            }
        }
        if (this.ˋ != null) {
            ॱ = ॱ(this.ˏ.getClass(), c.class);
            if (ॱ != null) {
                ॱ.ॱ(this.ˏ, o_cjt.ॱ(this.ˋ, ॱ.ˊ()));
            }
        }
        return this.ˏ;
    }

    private cji ॱ(Class<?> cls, Class<?> cls2) {
        Type type = cls;
        while (cls != null) {
            for (Field field : cls.getDeclaredFields()) {
                if (cls2.isAssignableFrom(field.getType())) {
                    return new cji(field, cjs.ॱ(cjs.ॱ(type, field.getDeclaringClass(), field.getGenericType())));
                }
            }
            Type ॱ = cjs.ॱ(type, cls, cls.getGenericSuperclass());
            cls = cls.getSuperclass();
            type = ॱ;
        }
        return null;
    }
}
